home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / iconv < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.2 KB  |  49 lines

  1. # iconv(1) completion
  2.  
  3. have iconv &&
  4. _iconv()
  5. {
  6.     local cur prev split=false
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur prev
  10.  
  11.     _split_longopt && split=true
  12.  
  13.     case $prev in
  14.         -'?'|--help|--usage|-V|--version|--unicode-subst|--byte-subst|\
  15.         --widechar-subst)
  16.             return 0
  17.             ;;
  18.         -f|--from-code|-t|--to-code)
  19.             COMPREPLY=( $( compgen -W '$( iconv -l | \
  20.                 sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) )
  21.             return 0
  22.             ;;
  23.         -o|--output)
  24.             _filedir
  25.             return 0
  26.             ;;
  27.     esac
  28.  
  29.     $split && return 0
  30.  
  31.     if [[ "$cur" = -* ]]; then
  32.         COMPREPLY=( $( compgen -W '--from-code --to-code --list -c
  33.             --unicode-subst --byte-subst --widechar-subst --output --silent
  34.             --verbose --help --usage --version' -- "$cur" ) )
  35.         return 0
  36.     fi
  37. } &&
  38. complete -F _iconv -o default iconv
  39. # Intentionally not -o filenames here, -f/-t completions may contain slashes
  40. # and -o filenames would break them.
  41.  
  42. # Local variables:
  43. # mode: shell-script
  44. # sh-basic-offset: 4
  45. # sh-indent-comment: t
  46. # indent-tabs-mode: nil
  47. # End:
  48. # ex: ts=4 sw=4 et filetype=sh
  49.